<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<h1>Object Example</h1>
<script>
function Member(){//Member클래스 정의
	//필드를 정의할 때는 반드시 this를 사용해야함
	this.irum='park';
	this.age=18;
	this.address='seoul';
	this.score=90;
	//setter 정의
	this.setIrum=function(v){this.irum=v;}
	this.setAge=function(v){this.age=v;}	
	this.setAddress=function(v){this.address=v;}	
	this.setScore=function(v){this.score=v;}
	//getter 정의
	this.getIrum=function(){return this.irum;}
	this.getAge=function(){return this.age;}	
	this.getAddress=function(){return this.address;}	
	this.getScore=function(){return this.irum;}
}

var m=new Member();
document.write(m.irum);

m.setIrum("kim")
document.write(m.irum);

</script>

</body>
</html>